<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
    <!-- 引入cdn的Vue.js文件 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.js"></script>
</head>

<body>
    <!-- 创建MVVM中的V——>View视图 -->
    <div id="app">
        <p @click="updata">{{message}}</p>
        <button @click="add">{{count}}</button>
    </div>
    <script>
        // MVVM中的VM——>ViewModel
        const vm = new Vue({
            el: '#app',
            data: {
                // MVVM中的M——>model数据
                message: 'helloWorld',
                count: 1,
            },
            methods: {
                add() {
                    this.count++
                },
                updata() {
                    this.message = 'Hello Vue'
                }
            }
        })
    </script>
</body>

</html>